const prod = require('./webpack.prod')
const { resolve } = require('path')
module.exports = {
  ...prod,
  mode: 'development',
  devServer: {
    static: {
      directory: resolve(__dirname, '../build'),
    },
    open: true,
    port: 9000,
    historyApiFallback: true, //增加此配置项. 当找不到对应路由时，会将其定位到/
    proxy: {
      '/api': {
        target: 'http://localhost:5000',
        pathRewrite: { '^/api': '' },
      },
    },
  },
}
